from detalles_especie.forms import FuenteExternaForm
from detalles_especie.models import FuenteExterna
from django.conf.urls import patterns, url, include
from django.views import generic
import autocomplete_light


urlpatterns = patterns('detalles_especie.views',
                       
    url(r'^$', 'listar',name='detalle_listar'),
    url(r'^listar_por/(?P<ordenar_por>\w+)/$', 'listar_por_ordenar',name='listar_por_ordenar'),
    url(r'^filtrar/$', 'filtrar',name='detalle_filtrar'),
    url(r'^aprobar/$', 'aprobar',name='detalle_aprobar'),
    url(r'^aprobar/(?P<object_id>\d+)/$', 'aprobar_confirmar',name='detalle_aprobar_confirmar'),
    url(r'^aprobar/(?P<object_id>\d+)/form/$', 'aprobar_confirmar_form',name='detalle_aprobar_confirmar_form'),
    url(r'^(?P<object_id>\d+)/$', 'ver', name='detalle_ver'),
    url(r'^crear/$', 'crear_con_experto',name='detalle_crear'),
    url(r'^(?P<object_id>\d+)/editar/$', 'editar',name='detalle_editar'),
    url(r'^(?P<object_id>\d+)/eliminar/$', 'eliminar'),
    url(r'fuentes/add/$', 
        autocomplete_light.CreateView.as_view(
                                              model=FuenteExterna,
                                              form_class=FuenteExternaForm), 
        name='fuente_create'),
    url(r'fuentes/(?P<pk>\d+)/update/$', generic.UpdateView.as_view(
        model=FuenteExterna, form_class=FuenteExternaForm), name='fuente_update'),
)

